Application control method and apparatus, electronic device, and storage medium

ABSTRACT

This application relates to an application control method performed by an electronic device that runs a native application and a sub-application nested in the native application. The method includes: receiving, by the native application, an object creation instruction transmitted by the sub-application; in response to the object creation instruction, creating, by the native application, a native object, wherein the native object is configured for performing operation on target multimedia content in the sub-application; receiving, by the native application, an object calling instruction transmitted by the sub-application; and in response to the object calling instruction, executing, by the native application, the native object and returning an execution result of the native project to the sub-application, wherein the sub-application is configured for performing corresponding operation on target multimedia content according to the execution result.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application of U.S. patentapplication Ser. No. 17/974,454, entitled “APPLICATION CONTROL METHODAND APPARATUS, ELECTRONIC DEVICE, AND STORAGE MEDIUM” filed on Oct. 26,2022, which is a continuation application of PCT Patent Application No.PCT/CN2022/070027, entitled “APPLICATION PROGRAM CONTROL METHOD ANDAPPARATUS, ELECTRONIC DEVICE, AND STORAGE MEDIUM” filed on Jan. 4, 2022,which claims priority to Chinese Patent Application No. 202110000662.9,filed with the State Intellectual Property Office of the People'sRepublic of China on Jan. 4, 2021, and entitled “EDITING CONTROL METHODAND APPARATUS FOR MULTIMEDIA CONTENT, ELECTRONIC DEVICE, AND STORAGEMEDIUM”, all of which are incorporated herein by reference in theirentirety.

FIELD OF THE TECHNOLOGY

This application relates to the field of computer technologies, and inparticular, to an application control method and apparatus, anelectronic device, and a storage medium.

BACKGROUND OF THE DISCLOSURE

With the development of communication technology and the popularizationof intelligent terminals, sub-applications as light applications havebecome an important form of mobile Internet applications, for example,users can handle various services or perform social activities and thelike through the sub-applications based on native applications. Thenative applications can be social applications like instant messagingsoftware, tool applications like picture modification software andoffice software, audio-video entertainment applications like short videosoftware and game software, content publishing applications likethird-party consumption comment software, content informationapplications like browsers and news software, and system applicationslike vehicle-mounted applications. The sub-applications can be usedwithout downloading and installing and cannot occupy the storage spaceof the electronic device, and therefore the sub-applications are widelyaccepted by the users.

In related technologies, the audio and video capability of thesub-applications can only be realized through a third-party audio andvideo editing library. However, introducing of the third-party audio andvideo editing library into the webpage side will cause large volume of afront-end application package, and the sub-applications generally limitthe volume of the package.

SUMMARY

An embodiment of this application provides an application control methodand apparatus, an electronic device, and a storage medium, aiming atproviding multimedia content editing capability for sub-applicationswithout increasing the volume of an application package.

A first type of application control method provided by the embodiment ofthis application is performed by the electronic device and includes:

-   -   running a native application and a sub-application nested in the        native application in the electronic device;    -   transmitting an object creation instruction to the native        application in response to detecting an operation request for a        target multimedia content by the sub-application, the object        creation instruction including parameter information        corresponding to a native object to be created and enabling the        native application to create the native object according to the        parameter information, and the native object being used for        performing operation on the target multimedia content in the        sub-application;    -   transmitting the object calling instruction to the native        application in response to determining the native object created        by the native application so as to enable the native application        to call the native object and execute a function code of the        native object; and    -   receiving an execution result returned by the native        application, and performing corresponding operation on the        target multimedia content according to the execution result.

A second type of application control method provided by the embodimentof this application is performed by the electronic device and includes:

-   -   running the native application and the sub-application nested in        the native application in the electronic device;    -   creating the native object according to the parameter        information corresponding to the native object to be created in        the object creation instruction after receiving the object        creation instruction transmitted by the sub-application, the        object creation instruction being transmitted during the        sub-application detects the operation request for the target        multimedia content, and the native object being used for        performing operation on the target multimedia content in the        sub-application;    -   calling the native object after receiving the object calling        instruction transmitted by the sub-application, and executing        the function code of the native object, the object calling        instruction being transmitted during the sub-application        determines that the native object is created by the native        application; and    -   returning the execution result to the sub-application, and        performing corresponding operation on the target multimedia        content through the sub-application according to the execution        result.

A first type of application control apparatus provided by the embodimentof this application includes:

-   -   a running unit for running the native application and the        sub-application nested in the native application in the        electronic device;    -   a first transmission unit for transmitting the object creation        instruction to the native application when the sub-application        detects the operation request for the target multimedia content,        the object creation instruction including the parameter        information corresponding to the native object to be created and        enabling the native application to create the native object        according to the parameter information, and the native object        being used for performing operation on the target multimedia        content in the sub-application;    -   a second transmission unit for transmitting the object calling        instruction to the native application in response to determining        the native object created by the native application so as to        enable the native application to call the native object and        execute the function code of the native object; and    -   a control unit for receiving an execution result returned by the        native application, and performing corresponding operation on        the target multimedia content according to the execution result.

A second type of application control apparatus provided by theembodiment of this application includes:

-   -   a running unit for running the native application and the        sub-application nested in the native application in the        electronic device;    -   an object creating unit for creating the native object according        to the parameter information corresponding to the native object        to be created in the object creation instruction after receiving        the object creation instruction transmitted by the        sub-application, the object creation instruction being        transmitted during the sub-application detects the operation        request for the target multimedia content, and the native object        being used for performing operation on the target multimedia        content in the sub-application;    -   an object calling unit for calling the native object after        receiving the object calling instruction transmitted by the        sub-application, and executing the function code of the native        object, the object calling instruction being transmitted during        the sub-application determines that the native object is created        by the native application; and    -   a first feedback unit for returning the execution result to the        sub-application, and performing corresponding operation on the        target multimedia content through the sub-application according        to the execution result.

Embodiments of this application provide an electronic device, includinga processor and a memory, the memory storing program code, the programcode, when executed by the processor, causing the processor to performthe operations of any one of the foregoing application control methods.

An embodiment of this application provides a computer program product ora computer program. The computer program product or the computer programincludes computer instructions, and the computer instructions are storedin a computer-readable storage medium. A processor of a computer devicereads the computer instructions from the computer-readable storagemedium and executes the computer instructions to cause the computerdevice to perform the operations of any one of the foregoing applicationcontrol methods.

An embodiment of this application provides a computer-readable storagemedium, including program code, the program code, when run on anelectronic device, being configured to cause the electronic device toperform the operations of any one of the foregoing application controlmethods.

The embodiments of this application provide an application controlmethod and apparatus, an electronic device, and a storage medium.Specifically, when the operation is performed on the target multimediacontent through the sub-application, the object creation instruction istransmitted to the native application, and the object callinginstruction is transmitted to the native object after determining thenative object created by the native application, wherein the nativeobject is an object used for performing operation on the multimediacontent, and therefore the operation on the target multimedia contentcan be achieved by calling the native object and executing correspondingfunction codes. Due to the fact that the capacity of a native system iscombined in the embodiment of this application, through the interactionbetween the sub-application and the native application, thesub-application can gain the basic multimedia content editing capabilitywithout depending on a third-party operation function library such as athird-party audio and video editing library, and the package volume ofthe sub-application cannot be increased.

Other features and advantages of this application will be described inthe subsequent specification, and partially become apparent from thespecification, or be understood by implementing this application.Objectives and other advantages of this application may be implementedand obtained by using structures particularly mentioned in thespecification, the claims, and the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings described herein are used for providing afurther understanding of this application, and form part of thisapplication. Exemplary embodiments of this application and descriptionsthereof are used for explaining this application, and do not constituteany inappropriate limitation to this application. In FIGS:

FIG. 1 is a schematic diagram of introducing a third-party audio andvideo editing library into a mini program in related art;

FIG. 2 is a selectable schematic diagram of an application scene in anembodiment of this application;

FIG. 3 is a flow schematic diagram of a first type of applicationcontrol method in an embodiment of this application;

FIG. 4 is a schematic diagram of an interaction flow between a miniprogram and a native application in an embodiment of this application;

FIG. 5 is a schematic diagram of creating a native object by a plug-inof a native application according to an instruction transmitted by amini program in an embodiment of this application;

FIG. 6 is an interface level schematic diagram of skipping introducingsame-layer rendering in an embodiment of this application;

FIG. 7 is an interface level schematic diagram of introducing same-layerrendering in an embodiment of this application;

FIG. 8 is a schematic diagram of a WebView node tree in an embodiment ofthis application;

FIG. 9 is a schematic diagram of storing a native object by a nativeapplication in an embodiment of this application;

FIG. 10 is a flow schematic diagram of a second type of applicationcontrol method in an embodiment of this application;

FIG. 11 is a flow schematic diagram of selectable interactionrealization time sequence in an embodiment of this application;

FIG. 12 is a schematic diagram of a composition structure of a firsttype of application control apparatus in an embodiment of thisapplication;

FIG. 13 is a schematic diagram of a composition structure of a secondtype of application control apparatus in an embodiment of thisapplication; and

FIG. 14 is a schematic diagram of a composition structure of hardware ofan electronic device according to an embodiment of this application;

DESCRIPTION OF EMBODIMENTS

To make the objectives, technical solutions, and advantages of theembodiments of this application clearer, the technical solutions in thisapplication will be clearly and completely described in the followingwith reference to the accompanying drawings in the embodiments of thisapplication. Apparently, the described embodiments are merely a partrather than all of the embodiments of the technical solutions of thisapplication. All other embodiments obtained by a person of ordinaryskill in the art based on the embodiments recorded in the document ofthis application without creative efforts shall fall within theprotection scope of the technical solutions of this application.

The following describes some concepts involved in the embodiments ofthis application.

Native application: the native application is also called as a “mainapplication” and is opposite to a network application, and the nativeapplication is installed on a terminal device and can use hardwarefunctions of the terminal device (such as a loudspeaker, an accelerationsensor and a camera). The native application can be downloaded from anapplication market. A sub-application and the native application in theembodiment of this application have a nested relationship, and thesub-application is nested in the native application.

Sub-application: the sub-application refers to an application developedbased on a framework of the native application, and has an own lifecycle and a basic interface. A user can obtain the sub-applicationthrough an URL address in the native application after installing andrunning the native application, instead of downloading and installingthe sub-application from the application market. For example, in thenative application, the user scans a two-dimensional code of thesub-application to obtain the URL address of the sub-application fromthe two-dimensional code and then downloads from this address to obtainthe sub-application; or, the user directly searches the sub-applicationin the native application, obtains the URL address and downloads it fromthis address. For example, the sub-application is a mini program runningbased on the native application and can bear specific functions underthe native application. For example, in the native application “Wesee”,red packets can be added for a video through the mini program; forexample, in the native application “Meitu”, basic picture editing can beperformed through the mini program; and for another example, in thenative application “DianPing”, the video can be uploaded for publishingan evaluation through the mini program.

DOM (Document Object Model): it is a standard programming interface forprocessing an extensible markup language. On a webpage, objects of anorganization page (or document) are organized in a tree structure to beused for representing a standard model of the objects in the document,and the standard model is called DOM.

Objects and classes: the objects are variables with reference types ofclasses. The classes and the objects are the most basic concepts in theobject-oriented programming technology. The objects with the sameattribute are called classes.

Native Object: the native object can also be called a local object or aninternal object and is a data structure dynamically created in therunning process of the native application, and the data structureincludes elements such as a class name, a method name and parameters.

Dictionary: the dictionary is a data structure for storing data in akey-value pair mode, for example, name-telephone number, namely, thecorresponding telephone number can be found through the name, the nameis the key, and the telephone number is the value. The key in thedictionary is an index of the value in the dictionary. For JavaScript,the basis of the Dictionary class is the Array class, and the Array inJS is an array and is also a dictionary. In the embodiment of thisapplication, the native application can store all created native objectsbased on the global data dictionary so as to keep the calling of thesub-application to the native object.

Plug-in: the plug-in is a program compiled by Application Interfaces(API) conforming to a certain specification. The plug-in the embodimentof this application is mainly an audio and video plug-in provided on anative application side, and the plug-ins contain a large number of APIsthrough which the sub-applications can be flexibly combined and designaudio and video editing capability with rich functions.

Same-layer rendering: it refers to that a native component is directlyrendered to a WebView (webpage view) level through a certain technicalmeans, at the moment, the native component layer does not exist, and thenative component is directly mounted to a WebView node. In theembodiment of this application, the playing interface of the targetmultimedia content is displayed in the sub-application page of thesub-application, and in the rendering process, the playing interface andthe sub-application page are obtained through same-layer rendering.

The design idea of the embodiment of the application is brieflyintroduced as follows:

With the continuous development of communication technology and thepopularization of computer technology, various applications (APPs) enterthe daily life of people, and the sub-application serves as a programwhich can be used immediately only by scanning a two-dimensional code orsearching, instead of downloading and installing from the applicationmarket. The sub-application has the characteristics of no need ofinstallation and uninstallation, capability of being cleared after beingused and no occupation of a mobile phone internal memory, and is widelyconcerned by all walks of life. At present, sub-applications of APPs aredeveloped in various industries in order to facilitate popularizationand seize user flow, and the playing of audio and video in thesub-applications gradually becomes a demand urgently realized by people.

In related art, the audio and video capability of the sub-applicationscan only be realized through a third-party audio and video editinglibrary. For example, as shown in FIG. 1 , the mini program carries anFFmpeg (Fast Forward Mpeg, an open source computer program) or a WebRTC(Web Real-Time Communication) library to realize the audio and videoediting capability. Other sub-applications also have similar processingways. However, introducing of the third-party audio and video editinglibrary into the webpage side will cause large volume of a front-endapplication package, and the sub-applications generally limit the volumeof the package.

Therefore, the embodiment of this application provides the applicationcontrol method and apparatus, the electronic device, and the storagemedium. Specifically, when the operation is performed on the targetmultimedia content through the sub-application, the object creationinstruction is transmitted to the native application, and the objectcalling instruction is transmitted to the native object afterdetermining the native object created by the native application, whereinthe native object is an object used for performing operation on themultimedia content, and therefore the operation on the target multimediacontent can be achieved by calling the native object and according tothe execution effect. Due to the fact that the capacity of a nativesystem is combined in the embodiment of this application, through theinteraction between the sub-application and the native application, thesub-application has very perfect audio and video editing capability,including basic audio and video editing capability. Moreover, in theembodiment of this application, the third-party audio and video editinglibrary does not need to be introduced, and no package volume incrementexists, so that the sub-application has the same good performance as thenative application; and compared with the prior art, the sub-applicationhas a smaller package volume, and thus the audio and video applicationis easier to realize and implement.

The following describes the exemplary embodiments of the applicationwith reference to the accompanying drawings of the specification. It isto be understood that the exemplary embodiments described herein aremerely used for illustrating and explaining this application, but arenot intended to limit this application. In addition, the embodiments ofthis application and features in the embodiments may be mutuallycombined in a case of no conflict.

FIG. 2 is a schematic diagram of an application scenario according to anembodiment of this application. The diagram of the application scenarioincludes two terminal devices 210 and a server 220. The terminal device210 may communicate with the server 220 by using a communicationnetwork.

In an implementation, the communication network is a wired network or awireless network. The terminal device 210 and the server 220 may bedirectly or indirectly connected in a wired or wireless communicationmanner. This is not limited in this application.

In the embodiment of this application, a terminal device 210 is anelectronic device used by a user, and the electronic device can becomputing devices such as a personal computer, a mobile phone, a tabletpersonal computer, a laptop, an electronic book reader and a smart homewhich have certain computing power and run with instant messagingsoftware and websites or social software and websites. The foregoingserver 220 may be an independent physical server, or may be a servercluster or a distributed system formed by a plurality of physicalservers, or may be a cloud server that provides a basic cloud computingservice such as a cloud service, a cloud database, cloud computing, acloud function, cloud storage, a network service, cloud communication, amiddleware service, a domain name service, a security service, a contentdelivery network (CDN), big data, and an artificial intelligenceplatform.

Each terminal device 210 can be provided with the native applicationwith multimedia content editing capability, for example, a nativeapplication with audio and video editing capability, and a nativeapplication with image animation editing capability; and thesub-application is nested in the native application.

The embodiment of this application is mainly illustrated by taking audioand video editing as an example, and the basic audio and video editingcapability in the sub-application can be used on various products withaudio and video editing requirements. Based on this capacity, thesub-application can realize the functions of: audio and video clipping,speed change, special effects, templates, red packet effects and thelike. Common products capable of realizing the audio and video editingcapability in the sub-application include: audio and video entertainmentapplications like adding red packets to published videos through a shortvideo software mini program, enabling the user to get the red packetwhile browsing the short videos, and providing special effects when theuser records the short videos, game software through which the user canplay games while live broadcasting and the like through the miniprogram, tool applications such as picture modification software throughwhich the user can perform basic picture editing through the miniprogram, office software which can provide the template for the userthrough the mini program, content publishing applications such asthird-party consumption comment software through which the user canupload video and publish evaluation by the mini program, contentinformation applications such as a browser through which the user cancarry out audio and video clipping, speed change and the like by awebpage mini program, and social class applications such as instantmessaging software through which the user can browse audios and videosby the mini program.

In addition, the mini program listed in the embodiment of thisapplication not only can be nested on the listed terminal APP, but alsocan be transferred to the Internet automobile, so that one-stop servicefrom travel to life is provided for the user, and a series service scenebefore getting on the automobile, during driving and after getting offthe automobile is realized. Correspondingly, the native application canbe a system application, such as a vehicle-mounted application, the usercan achieve the functions of audio and video clipping, speed changing,special effects, templates, red packet effects and the like through thevehicle-mounted mini program; and based on achievement of the audio andvideo editing capability, various intelligent services from travel tolife can be provided for the user around a vehicle scene.

Compared with the prior technologies, the application control method inthe embodiment of this application combines the JS interactiontechnology of the WebView, WebView same-layer rendering, asub-application plug-in mode and an internal memory managementmechanism.

An editing control method in the embodiment of this application isintroduced in detail as follows by mainly taking the sub-applicationserving as the mini program as an example and in conjunction with theaccompanying drawings:

FIG. 3 is the flow schematic diagram of the first type of applicationcontrol method in the embodiment of this application, the method isperformed by the electronic device, for example, the terminal device 210in the FIG. 2 . The method is applied to the sub-application, and thespecific implementation flow is as follows:

S30: Run the native application and the sub-application nested in thenative application in the electronic device.

In the embodiment of this application, the native application is used asthe main application, and the sub-application is nested in the nativeapplication.

S31: Transmit an object creation instruction to the native applicationwhen the sub-application detects an operation request for targetmultimedia content, the object creation instruction including parameterinformation corresponding to a native object to be created and enablingthe native application to create the native object according to theparameter information, and the native object being used for performingoperation on the target multimedia content in the sub-application.

In the embodiment of this application, the operation on the multimediacontent includes various editing controls, and can be divided into aplurality of control types, such as clipping, speed change, coding anddecoding, sticker, special effect addition and template loading. Thenative object herein refers to a native object for performing a specificcertain type of control on the multimedia content, for example, inresponse to clipping the target multimedia content, it is needed tocreate a type of native object A for performing clipping control on themultimedia content; and in response to performing speed change on thetarget multimedia content, it is needed to create a type of nativeobject B for performing speed change control on the multimedia content,etc.

In response to performing editing control on the target multimediacontent through the mini program, it is needed to transmit the objectcreation instruction to the native application, the parameterinformation in the instruction specifically refers to the object type,the object class name and the like, thus the native object is indicatedto determine the type of editing control to be performed on themultimedia content; and different controls correspond to different audioand video editing capabilities. For example, in response to clipping theaudio and video, the corresponding class name is “TAVClip”, and inresponse to coding and decoding the audio and video, the correspondingclass name is “TAVPlayer”.

After receiving the object creation instruction transmitted by thesub-application, the native application will create a native objectaccording to the parameter information corresponding to the nativeobject to be created in the object creation instruction, and allocate aninternal memory to the native object.

In addition, in response to utilizing the basic API provided by thewebpage end to realize the audio and video editing capability of themini program, it is difficult to realize part of the capability or theperformance is poor due to the fact that the API of the webpage end onaudio and video processing is not perfect enough. According to theembodiment of this application, the capability of the native applicationis combined, the native API is directly exposed, thus the mini programhas the basic audio and video editing capability, the package volume isnot increased, and the rendering performance is improved.

In some embodiments, on the native application side, the nativeapplication is capable of analyzing the parameter information in theinstruction in response to creating the native object according to theparameter information corresponding to the native object to be createdin the object creation instruction, and selecting a target API needed tobe called for creating the native object from a pre-configured API setaccording to the analyzed parameter information; and calling the targetAPI to create the native object. APIs in the API set are APIs associatedwith the audio and video editing capability of the sub-application. TheAPI set in the embodiment of this application mainly refers to an APIlist, and the list can include the six listed APIs.

For example, in response to clipping the target multimedia contentthrough the mini program, the class name in parameter information can be“TAVClip”, and a corresponding target API is the API to be clipped; andin response to coding and decoding the audio and video through the miniprogram, the class name in the parameter information can be “TAVPlayer”,the corresponding target API is the API to be clipped.

It is to be noted that the API related to the audio and video editingcapability provided by the native application listed in the embodimentof this application is only illustrated, and in fact, any API related tothe audio and video editing capability is suitable for the embodiment ofthis application and is not specifically limited.

According to the native object internal memory management mechanism, thenative object created through interaction of the mini program and thenative application has the following problem that if the native objectis created, but is not held, the internal memory will be released by thesystem. The object cannot be found when the mini program transmits amessage next time. In order to solve this problem, an object storagemethod based on a global data dictionary is provided in the embodimentof this application.

In the native layer, the global data dictionary is used for storing thecreated objects, and as long as the objects created by the mini programare stored in the global dictionary, reference is kept.

S32: Transmit an object calling instruction to the native application inresponse to determining the native object created by the nativeapplication so as to enable the native application to call the nativeobject and execute a function code of the native object.

According to the embodiment of this application, the sub-application iscapable of transmitting a JS message containing the object callinginstruction to the native application, analyzing the internal memoryaddress and the class name by the native application according to the JSmessage, then calling the native object, executing the function code ofthe native object, performing corresponding processing, and returning anexecution result to the sub-application.

Specifically, after receiving the JS message, the plug-in the nativeapplication is capable of automatically distributing to the target APIused for calling the native object to realize simple expansion of alarge number of APIs during distribution and improve the audio and videoediting control efficiency. It is to be noted that the plug-in thenative application specifically refers to plug-ins related to audio andvideo editing capability, such as coding and decoding, clipping, speedchange, stickers, special effects and templates, which are all relatedto audio and video editing.

S33: Receive an execution result returned by the native application, andperform corresponding operation on the target multimedia content in thesub-application according to the execution result.

For example, the target multimedia content is a video file A, and inresponse to adjusting the playing speed of the video file A to be 2times of the speed, the sub-application is capable of performingspeed-multiplied playing on the video file A according to the executionresult returned by the native application.

According to the embodiment of this application, the sub-application andthe native application interact through a browser component in anunderlying operating system. In this way, the underlying function of theoperating system is effectively utilized, so that the efficiency of datatransmission between the sub-application and the native application ishigher, and the package volume of the sub-application cannot beincreased.

By taking the sub-application serving as the mini program as an example,FIG. 4 is the schematic diagram of the interaction flow between the miniprogram and the native application in the embodiment of thisapplication, and the sub-application includes a mini program 410, anoperating system 420 and a native application 430. The mini program 410is capable of receiving the operation request of the user on the targetmultimedia content 411 and giving a response. In the operating system420, the browser component includes a WebView 421 and a Webkit 422. TheWebView 421 is a control for displaying a web page based on the Webkit422.

For example, when the user taps to open a certain webpage and performsoperation on the target multimedia content 411 on the webpage throughthe mini program 410, an application code of the mini program 410 isloaded to the WebView 421 to run, and at the moment, the mini program410 will transmit the object creation instruction to the nativeapplication 430 through the Webkit 422 according to the receivedoperation request. Specifically, the object creation instruction istransmitted in a form of a JS message.

The native application 430 is capable of analyzing the parameterinformation in the object creation instruction according to the receivedJS message, judging which target API is called according to the analyzedparameter information, and then creating the native object. That is, thenative objects are in one-to-one correspondence with the parameterinformation. For example, according to the class name included in theparameter information, the created native object can be any one of aname of coding and decoding 431, a name of clipping 432, a name of speedchange 433, a name of sticker 434, a name of special effect 435 and aname of template 436.

After creating the native object by the native application 430, theobject information of the native object is returned to the mini program410 through the Webkit 422, and the object information includes theinternal memory address and the class name. Therefore, the mini program410 is capable of determining the native object created by the nativeapplication 430 after receiving the object information, and thentransmitting the object calling instruction to the native application430 through the Webkit 422.

The native application 430 is capable of calling the previously creatednative object such as a native object with the name of coding anddecoding 431 after receiving the object calling instruction, andexecuting the function code corresponding to the native object. Thefunction code refers to a code required for performing correspondingoperation on the target multimedia content, and is indicated through amethod name in a data structure of the native object.

After the native application 430 executes the function codecorresponding to the native object, the processed data is obtained asthe execution result. For example, the operation request is to clip thevideo, and then the execution result is the duration of the clippedsegment.

Finally, the native application 430 is capable of transmitting theexecution result to the mini program 410 through the Webkit 422. Themini program 410 directly performs operation on the target multimediacontent according to the received execution result, for example,displaying the clipped segment. Therefore, the interaction between themini program 410 and the native application 430 is achieved.

In the embodiment of this application, three basic interfaces areprovided for the mini program based on the interaction process shown inFIG. 4 : an object creating interface, an object releasing interface andan object calling interface, and the specific configuration is asfollows:

Interface 1: object creating interface. functav_creatObject(className:String,methodName:String,param:Param)−>(object:TAVObject);

func represents the abbreviation of the function, the function name ofthe interface is tav_creatObject, className represents the class name,and className:String represents that the class name is of a characterstring type; methodName represents the method name, and methodName:String represents that the method name is also of a character stringtype; and param represents the parameter and can specifically include aname (a parameter name) and a value.

For example, an object is created, and the name of the object isTAVObject (audio and video object).

 Interface 2: object releasing interface.  functav_raleaseObject(object:TAVObject);  The function name of the interfaceis tav_raleaseObject.  Interface 3: object calling interface.  func tav_sendMsgToObject(object:TAVObject,methodName:String,param: Param).

The function name of the interface is tav_sendMsgToObject, objectrepresents the object to be called, TAVObject is the name of the objectto be called, methodName:String represents that the method name is alsoof a character string type; and param represents a parameter.

In the embodiment of this application, through the three basicinterfaces and different parameters, the mini program can call variousaudio and video interfaces of the native layer, and the basiccommunication between the mini program and the native layer can be met.

FIG. 5 is the schematic diagram of creating the native object by theplug-in of the native application according to the instructiontransmitted by the mini program in the embodiment of this application.The upper half part of the figure refers to the form that a mini program510 transmits out the object creation instruction. Specifically, themini program 510 transmits out the object creation instruction byexecuting a specific function, such as the functionxx.inokeNativePlugin, it is used for indicating to call the plug-in inthe native application (called as a native plug-in for short) so as tocreate a native object. Specific codes are as follows:

 xx.inokeNativePlugin ({ /call native plug-in api_name:“tav_creatObject”, /interface name: tav_creatObject (audiovideo_create object)  data:{ /data  “className”:“TAVClip”, /classname: TAVClip (audio and video clipping) “methodName”:“resource”,“param”:{“resource”: resource} /methodname: resource (resource) , parameter {resource: resource}  }, Success:{ }, /success  fail:{ } /fail  })

The abovementioned code represents that the object creation instructionis transmitted through a basic interface tav_creatObject of the miniprogram 510, and the instruction indicates that the class name of thenative object is TAVClip and is used for clipping audios and videos; themethod name is resource.

The mini program 510 transmits the object creation instruction to anative application 530 through a Webkit 520. Then, the nativeapplication 530 distributes the className, the methodName and the paramto a corresponding target API531, and creates a native object with thecorresponding class name. For example, the target API531 is TAVClip(audio and video clipping), the name of the created native object isclipping 5321, and the class name is TAVClip; for example, the targetAPI531 is TAVPlayer (audio and video coding and decoding), the name ofthe created native object is coding and decoding 5322, and the classname is TAVPlayer; and for example, the target API531 isTAVExportSession (audio and video export), the name of the creatednative object is export 5323, and the class name is TAVExportSession.

In the embodiment of this application, the audio and video editing APIis provided by the native application, so that the generated texturepictures are all in the native application. And the mini program and thenative application communicate through the JS message, thus the texturedata cannot be transmitted.

In order to solve the problem of rendering the audio and video editingof the native application on the screen, the mini program in theembodiment of this application provides a same-layer renderingtechnology. That is, the playing interface of the target multimediacontent is displayed in the sub-application page of the sub-application,and the playing interface and the sub-application page are obtainedthrough same-layer rendering.

In the embodiment of this application, the core principle of same-layerrendering is to put the view of the native layer into the view level inthe WebView, and the view of the native layer can be treated as an html(HyperText Markup Language) tag. This is because the DOM elements can beused for creating the native view according to the tag during renderingthe WebView, and the same-layer rendering is to find an appropriateposition in the views and then insert the view of the native layer.

In related art, the content of the mini program is mostly rendered onthe WebView, and if the WebView is regarded as a single level, nativecomponents carried by the operating system are located at another higherlevel. And the two levels are completely independent. FIG. 6 is theinterface level schematic diagram of skipping introducing same-layerrendering, the non-native component is located on the WebView layer, andthe native component is located on the other higher level. Thenon-native component layer renders the mini program page, namely thesub-application page. The native component layer renders the playinginterface of the target multimedia content.

The same-layer rendering provided in the embodiment of this applicationrefers to directly rendering the native component to the WebView layerthrough a certain technical means, at the moment, the native componentlayer does not exist, and the native component is directly mounted onthe WebView node. The mini program can almost use the native componentrendered on the same layer like using a non-native component. Theinterface level after the same-layer rendering is enabled is shown inFIG. 7 . The picture rendered by the native application is directlyrendered to the native view and then nested into the mini program.Therefore, the sub-application page and the playing interface of thetarget multimedia content are obtained through same-layer rendering.

FIG. 8 is the schematic diagram of the WebView node tree in theembodiment of this application. The WebView is used for rendering anddisplaying the webpage and can be configured in a user-defined manner.In response to rendering in the mini program with the WebView, theWebView is used for rendering in a layered manner, a CompositingLayergenerated by a Webkit kernel is rendered into a WKCompositingView whichis a native view of a client, and the kernel renders a plurality of DOMnodes to a synthesis layer, therefore, there is no one-to-one mappingrelationship between the synthesis layer and the DOM nodes. In responseto setting the attributes of the Cascading Style Sheets (CSS) of the DOMnode as overflow: scroll, the WebView will generate a WKChildScrollViewfor the DOM node, there is a mapping relationship between theWKChildScrollView and the DOM node, and it is a subclass of a nativeUIScrollView, that is, scroll in the WebView is actually borne by a realnative scroll component, so that the WebView scroll brings a smootherexperience.

The same-layer rendering of the mini program is also realized based onthe WK sub-scroll view. As shown in FIG. 8 , the native component ismounted on the WK sub-scroll view node to serve as the sub-view of theWK sub-scroll view node, or, the native component is inserted into theWK sub-scroll view node to realize same-layer rendering; in this way,the layer problem of the native component is solved, meanwhile, thenative component has richer display and interaction capacity; and whenthe mini program renders the playing interface, the native component onthe same layer can be directly used, thus the rendering processingcomplexity is reduced, and the rendering processing efficiency isimproved.

In an implementation mode, the specific implementation process of stepS32 includes:

-   -   S321: determining the native object created by the native        application during receiving the object information of the        native object returned by the native application; and    -   S322: transmitting the object calling instruction to the native        application according to the object information.

Therefore, the native object is created through the native applicationand then is called by the sub-application, so that very perfect audioand video basic capability is provided for the sub-application,meanwhile, no package volume increment exists, and the sub-applicationcan have the same performance as the native application.

In response to storing the previously created object by the global datadictionary, there is still a problem that the object cannot be foundunder some conditions. For example, although the created objects are allstored in the global data dictionary, if the object attributes obtainedfrom the objects through the get method are not in the dictionary, theproblem that the objects cannot be found occurs. And if the userperforms dictionary storage once when calling by using the get method,it can be ensured that the object can be found, but the implementationcomplexity of the API can be increased.

In the embodiment of this application, a better method for solving theproblem is provided, and due to the fact that the object obtainedthrough the get method actually exists in the system internal memory allthe time, and there is a reference relationship, an instance object canbe dynamically obtained as long as the internal memory address and theclass name of the object are provided.

In some embodiments, after the native object is created by the nativeapplication, the address of the internal memory allocated to the nativeobject, the class name of the native object and other information aretaken as the object information, and the internal memory address and theclass name are provided in the data structure of the object returned bythe mini program, wherein the internal memory address refers to theaddress of the internal memory allocated to the native object by thenative application, and the class name refers to the type of the nativeobject. After the object information is received by the mini program,that the native object is created by the native application can bedetermined. When the mini program calls the object method, the internalmemory address and the class name are treated as object data, added tothe object calling instruction and transmitted back to the native layerof the native application, and the native layer dynamically creates theobject instance through the pointer, thus the calling of the nativeobject is achieved; and a method indicated in the native object datastructure is executed, namely, the function code is executed.

The specific process is that: when the mini program calls the nativeobject, the content address and the class name are added into the objectcalling instruction, and the object calling instruction is transmittedto the native application; after the native application receives theobject calling instruction containing the content address and the classname, the internal memory allocated to the native object is determinedaccording to the internal memory address, and the type of the nativeobject is determined according to the class name; and after the internalmemory allocated to the native object is indexed through the pointer,the native object is called according to the type of the native object.

The mode of adding the content address and the class name into theobject calling instruction is on the basis that the native object alwaysexists in the system internal memory and has a certain referencerelationship, so that the native object can be dynamically obtained byrepresenting the reference relationship through the content address andthe class name, and the processing efficiency of obtaining the objectduring interacting between the mini program and the native applicationis improved.

FIG. 9 is the schematic diagram of storing the native object by thenative application in the embodiment of this application. When a miniprogram 910 receives a Clip request for target multimedia content, theobject creation instruction is transmitted to a native application 920;and after the native application 920 receives the instruction, a nativeobject 921 with the name of clipping and the class name of TAVClip iscreated in a temporary internal memory. And then, the internal memory ofthe native object 921 is moved to a resident internal memory (namelyobject is stored in the global data dictionary), so that the miniprogram 910 can access the object.

Then, object information of the native object of the native application920 is returned to the mini program 910, and the object informationspecifically includes an identifier (object ID) and a className (objectclass name). In case that the mini program 910 calls the native objectto execute the Clip method, the identifier and the className are addedto the object calling instruction, and the object calling instruction istransmitted to a method transponder 922 of the native application 920.For example, in FIG. 9 , the object calling instruction includes theidentifier and the className, wherein the identifier is 0x3df3459,representing that the internal memory address of the native object is0x3df3459, and the className is Clip. After the native application 920receives the information, the internal memory position will be foundaccording to the identifier based on the method transponder 922, thetype will be determined according to the className, then the internalmemory 921 allocated to the native object will be indexed through thepointer, and finally, the method of the native object will be calledaccording to the type of the native object, namely the function code ofthe native object is executed.

According to the embodiment, the instance object can be dynamicallyobtained as long as the internal memory address and the class name ofthe native object are provided, so that the problem that the objectcannot be found due to the fact that the object attribute obtainedthrough the get method is not in the dictionary is solved.

In some embodiments, the mini program can transmit the object releaseinstruction for the native object to the native application aftercompleting the operation on the target multimedia content. Afterreceiving the object release instruction for the native object, thenative application releases the internal memory allocated to the nativeobject before.

Specifically, the mini program can release the object resource bycalling the release message. For example, the target multimedia contentis a video file A; after the video file A is clipped, namely, theediting control on the target multimedia content is finished, at themoment, the release message that is the object release instruction forthe native object TAVClip can be transmitted to the native application,wherein the instruction can include the internal memory address, theclass name, the object id and other information of the native object;and after the native application receives the release message, theinternal memory previously allocated to the native object can bereleased through a corresponding API. In addition, under the conditionof exiting the mini program or other conditions, plug-in destruction canbe carried out, and the native layer can automatically clean all relatednative objects.

In the embodiment, when the mini program completes certain editingcontrol on the target multimedia content, the object release instructionfor the native object used for the editing control can be transmitted tothe native application, and the native object releases the correspondinginternal memory to avoid internal memory overflow, so that enoughcontinuous internal memory space is provided for subsequent use.

Based on the same inventive concept, the embodiment of this applicationfurther provides an application control method which is applied to thenative application. FIG. 10 is the flow schematic diagram of the secondtype of application control method in the embodiment of thisapplication, the method is performed by the electronic device, such asthe terminal device 210 in FIG. 2 , and is applied to the nativeapplication. The specific implementation flow is as follows:

S100: running the native application and the sub-application nested inthe native application in the electronic device.

S101: creating the native object according to the parameter informationcorresponding to the native object to be created in the object creationinstruction after receiving the object creation instruction transmittedby the sub-application, the object creation instruction beingtransmitted during the sub-application detects the operation request forthe target multimedia content, and the native object being used forperforming operation on the target multimedia content in thesub-application;

S102: calling the native object after receiving the object callinginstruction transmitted by the sub-application, and executing thefunction code of the native object, the object calling instruction beingtransmitted during the sub-application determines that the native objectis created by the native application; and

S103: returning the execution result to the sub-application, andperforming corresponding operation on the target multimedia contentthrough the sub-application according to the execution result.

In some embodiments, after creating the native object and beforereceiving the object calling instruction transmitted by thesub-application, the method further includes:

-   -   returning the object information obtained by creating the native        object to the sub-application, determining the native object        created by the native application through the sub-application        during receiving the object information, and transmitting the        object calling instruction according to the object information.

In some embodiments, creating the native object according to theparameter information corresponding to the native object to be createdin the object creation instruction specifically includes:

-   -   analyzing the parameter information in the object creation        instruction, and selecting a target API to be called to create        the native object from a pre-configured API set, APIs in the API        set being APIs associated with the audio and video editing        capability of the sub-application; and    -   calling the target API to create the native object.

In the abovementioned way, the API associated with the audio and videoediting capability of the sub-application is called through the nativeapplication to create the native object, so that the sub-application hascertain audio and video editing capability, the third-party audio andvideo editing library is prevented from being added into thesub-application, for example, an FFmpeg or WebRTC library is carried inthe mini program, and from this perspective, the package volume of thesub-application with the audio and video editing capability is reduced.

In some embodiments, the object information includes the internal memoryaddress and the class name; the object calling instruction carries theinternal memory address and the class name; the internal memory addressrefers to the address of the internal memory allocated by the nativeapplication for the native object, and the class name refers to the typeof the native object.

Calling the native object after receiving the object calling instructiontransmitted by the sub-application specifically includes:

-   -   determining the internal memory allocated to the native object        according to the internal memory address, and determining the        type of the native object according to the class name; and    -   indexing the internal memory allocated to the native object        through the pointer, and calling the native object according to        the type of the native object.

In some embodiments, after creating the native object according to theparameter information corresponding to the native object to be createdin the object creation instruction, the method further includes:

-   -   storing the native object by the global data dictionary so as to        keep the calling of the sub-application to the native object.

Storage is carried out through the global data dictionary, so that thenative object can be stored in the internal memory all the time, it canbe guaranteed that the sub-application can access the native object, andthen the basic audio and video editing capability can be obtained.

In some embodiments, the method further includes:

-   -   releasing the internal memory allocated for the native object        after receiving the object release instruction transmitted by        the sub-application for the native object, the object release        instruction being transmitted by the sub-application after the        sub-application completes the operation for target multimedia        content.

FIG. 11 is the interaction time sequence diagram of the applicationcontrol method. The method includes the following specificimplementation processes:

-   -   S1101: transmitting the object creation instruction to the        native application through the mini program in response to        detecting the operation request for target multimedia content        through the mini program page;    -   S1102: analyzing to obtain the parameter information in the        object creation instruction according to the object creation        instruction through the native application, and selecting the        target API to be called for creating the native object from the        API set according to the analyzed parameter information;    -   S1103: calling the target API to create the native object        through the native application, and storing the created native        object through the global data dictionary;    -   S1104: returning object information obtained by creating the        native object to the sub-application through the native        application, the object information including the internal        memory address and the class name;    -   S1105: adding the internal memory address and the class name        into the object calling instruction through the mini program        during calling the native object, and transmitting the object        calling instruction to the native application;    -   S1106: determining the internal memory resources allocated to        the native object through the native application according to        the internal memory address, and determining the type of the        native object according to the class name;    -   S1107: calling the native object according to the type of the        native object after indexing the internal memory allocated for        the native object through the pointer, and executing the        function code of the native object to carry out corresponding        data processing on the target multimedia content;    -   S1108: returning the execution result to the mini program        through the native application; and    -   S1109: performing corresponding operation on the target        multimedia content according to the execution result through the        mini program.

Based on the same inventive concept, the embodiment of this applicationfurther provides an application control apparatus. FIG. 12 is theschematic diagram of the composition structure of the first type ofapplication control apparatus 1200 in the embodiment of thisapplication, the apparatus is applied to the sub-application andincludes:

-   -   a running unit 1201 for running the native application and the        sub-application nested in the native application in the        electronic device;    -   a first transmission unit 1202 for transmitting the object        creation instruction to the native application when the        sub-application detects the operation request for target        multimedia content, the object creation instruction including        parameter information corresponding to the native object to be        created and enabling the native application to create the native        object according to the parameter information, and the native        object being used for performing operation on the target        multimedia content in the sub-application;    -   a second transmission unit 1203 for transmitting the object        calling instruction to the native application in response to        determining the native object created by the native application        so as to enable the native application to call the native object        and execute the function code of the native object; and    -   a control unit 1204 for receiving the execution result returned        by the native application, and performing corresponding        operation on the target multimedia content according to the        execution result.

In some embodiments, the second transmission unit 1203 is specificallyconfigured to perform the functions of:

-   -   determining the native object created by the native application        during receiving the object information of the native object        returned by the native application; and    -   transmitting the object calling instruction to the native        application according to the object information.

In some embodiments, the object information includes the internal memoryaddress and class name; and the second transmission unit 1203 isspecifically configured to perform the functions of:

-   -   adding the internal memory address and the class name into the        object calling instruction during calling the native object;        transmitting the object calling instruction to the native        application; determining the internal memory allocated to the        native object by the native application according to the        internal memory address, and determining the type of the native        object according to the class name; indexing the internal memory        allocated to the native object through the pointer; and calling        the native object according to the type of the native object.

In some embodiments, the playing interface of the target multimediacontent is displayed in the sub-application page of the sub-application,and the playing interface corresponding to the target multimedia contentand the sub-application page are obtained through same-layer rendering.

In some embodiments, the apparatus further includes:

-   -   a third transmission unit 1205 for transmitting the object        release instruction for the native object to the native        application after the sub-application completes the operation on        the target multimedia content so as to enable the native        application to release the internal memory allocated to the        native object.

In some embodiments, the sub-application and the native applicationinteract through the browser component.

Based on the same inventive concept, the embodiment of this applicationfurther provides an application control apparatus. FIG. 13 is thestructural schematic diagram of an application program control apparatus1300 provided by the embodiment of this application, the apparatus isapplied to the native application and can include:

-   -   a running unit 1301 for running the native application and the        sub-application nested in the native application in the        electronic device;    -   an object creating unit 1302 for creating the native object        according to the parameter information corresponding to the        native object to be created in the object creation instruction        after receiving the object creation instruction transmitted by        the sub-application, the object creation instruction being        transmitted during the sub-application detects the operation        request for the target multimedia content, and the native object        being used for performing operation on the target multimedia        content in the sub-application;    -   an object calling unit 1303 for calling the native object after        receiving the object calling instruction transmitted by the        sub-application, and executing the function code of the native        object, the object calling instruction being transmitted during        the sub-application determines that the native object is created        by the native application;    -   a first feedback unit 1304 for returning the execution result to        the sub-application, and performing corresponding operation on        the target multimedia content through the sub-application        according to the execution result.

In some embodiments, the apparatus further includes:

-   -   a second feedback unit 1305 for returning the object information        obtained by creating the native object to the sub-application,        determining the native object created by the native application        through the sub-application during receiving the object        information, and transmitting the object calling instruction        according to the object information after the native object is        created by the object creating unit 1302 and before the object        calling unit 1303 receives the object calling instruction        transmitted by the sub-application.

In some embodiments, the object creating unit 1302 is specificallyconfigured to perform the functions of:

-   -   analyzing the parameter information in the object creation        instruction, and selecting a target API to be called to create        the native object from a pre-configured API set, APIs in the API        set being APIs associated with the audio and video editing        capability of the sub-application; and    -   calling the target API to create the native object.

In some embodiments, the object information includes the internal memoryaddress and the class name; the object calling instruction carries theinternal memory address and the class name; and the object calling unit1303 is specifically configured to perform the functions of:

-   -   determining the internal memory allocated to the native object        according to the internal memory address, and determining the        type of the native object according to the class name; and    -   indexing the internal memory allocated to the native object        through the pointer, and calling the native object according to        the type of the native object.

In some embodiments, the apparatus further includes:

-   -   a storage unit 1306 for storing the native object by the global        data dictionary so as to keep the calling of the sub-application        to the native object after creating the native object through        the object creating unit 1302 according to the parameter        information corresponding to the native object to be created in        the object creation instruction.

In some embodiments, the apparatus further includes:

-   -   an internal memory release unit 1307 for releasing the internal        memory allocated to the native object after receiving the object        release instruction for the native object transmitted by the        sub-application, the object release instruction being        transmitted by the sub-application after completing the        operation on the target multimedia content.

For ease of description, the foregoing components are respectivelydescribed as various modules (or units) divided according to functions.Certainly, during the implementation of this application, the functionof the various modules (or units) may be implemented in a same piece ofor multiple pieces of software or hardware.

After the application control method and apparatus of exemplaryimplementations of this application are described, the followingdescribes an electronic device according to another exemplaryimplementation of this application.

A person skilled in the art can understand that various aspects of thisapplication may be implemented as systems, methods, or computer programproducts. Therefore, the aspects of this application may be specificallyembodied in the following forms: hardware only implementations, softwareonly implementations (including firmware, micro code, etc.), orimplementations with a combination of software and hardware, which arecollectively referred to as “circuit”, “module”, or “system” herein.

Based on the same inventive concept as the above embodiment of themethod, and the embodiment of this application further provides anelectronic device. The electronic device can be used for transfercontrol of resource objects. In one embodiment, the electronic devicecan be a server, such as a server 220 shown in FIG. 2 , and can also bea terminal device, such as the terminal device 210 shown in FIG. 2 . Inthe embodiment, the structure of the electronic device can be shown inFIG. 14 , and the electronic device includes a memory 1401, acommunication module 1403 and one or more processors 1402.

The memory 1401 is configured to store a computer program executed bythe processor 1402. The memory 1401 may mainly include a program storagearea and a data storage area. The program storage area may store anoperating system, a program required for running an instant messagingfunction, and the like. The storage data area is configured to storevarious instant messaging information, operation instruction sets andthe like.

The memory 1401 may be a volatile memory such as a random-access memory(RAM); the memory 1401 may be a non-volatile memory such as a read-onlymemory, a flash memory, a hard disk drive (HDD) or a solid-state drive(SSD); or the memory 1401 is any other medium that can be used to carryor store expected program code that has an instruction or data structureform, and that can be accessed by a computer, but is not limitedthereto. The memory 1401 may be a combination of the foregoing memories.

The processor 1402 may include one or more central processing units(CPUs), or may be a digital processing unit, or the like. The processor1402 is configured to invoke the computer program stored in the memory1401, to perform the foregoing application control method.

The communications module 1403 is configured to communicate with aterminal device and an other server.

In this embodiment of this application, a specific connection mediumbetween the memory 1401, the communication module 1403, and theprocessor 1402 is not limited. In this embodiment of this application,in FIG. 14 , the memory 1401 and the processor 1402 are connected toeach other through a bus 1404. The bus 1404 is represented by using abold line in FIG. 14 . A manner of connection between other componentsis only schematically described, but is not used as a limitation. Thebus 1404 may be classified into an address bus, a data bus, a controlbus, and the like. For ease of description, the bus in FIG. 14 isrepresented by using only one bold line, but this does not indicate thatthere is only one bus or one type of bus.

The memory 1401 stores a computer storage medium. The computer storagemedium stores a computer-executable instruction. The computer-executableinstruction is used for implementing the application control methodaccording to the embodiments of this application. The processor 1402 isconfigured to execute the application control method, as shown in FIG. 3or FIG. 10 .

In some possible implementations, each aspect of the application controlmethod provided in this application may be further implemented in a formof a program product including program code. When the program product isrun on a computer device, the program code is used to enable thecomputer device to perform steps of the application control methodaccording to the various exemplary implementations of this applicationdescribed above in the specification. For example, the computer devicecan perform the steps shown in FIG. 3 or FIG. 10 .

The program product may adopt one readable medium or any combination ofreadable media. The readable medium may be a computer-readable signalmedium or a computer-readable storage medium. The readable storagemedium may be, for example, but is not limited to, an electric,magnetic, optical, electromagnetic, infrared, or semi-conductive system,apparatus, or device, or any combination thereof. More specific examples(non-exhaustive list) of the readable storage medium include anelectrical connection having one or more wires, a portable disk, a harddisk, a random access memory (RAM), a read-only memory (ROM), anerasable programmable read only memory (EPROM or a flash memory), anoptical fiber, a portable compact disk read-only memory (CD-ROM), anoptical storage device, a magnetic storage device, or any suitablecombination thereof.

The program product according to an implementation of this applicationmay use a CD-ROM, include program code, and may be run on a computingapparatus. However, the program product of this application is notlimited to this. In this specification, the readable storage medium maybe any tangible medium including or storing a program, and the programmay be used by or in combination with a command execution system, anapparatus, or a device.

The readable signal medium may include a data signal propagated inbaseband or propagated as a part of a carrier, and readable program codeis carried therein. The propagated data signal may be in a plurality offorms, including but not limited to, an electromagnetic signal, anoptical signal, or any appropriate combination thereof. The readablesignal medium may alternatively be any readable medium other than thereadable storage medium. The readable medium may be configured totransmit, propagate, or transmit a program used by or used incombination with a command execution system, an apparatus, or a device.

The program code included in the readable medium may be transmitted byusing any appropriate medium, including but not limited to, a wirelessmedium, a wired medium, an optical cable, radio frequency (RF) or thelike, or any appropriate combination thereof.

A person of ordinary skill in the art may understand that all or somesteps for implementing the foregoing method embodiment may be completedby a program instructing related hardware, the foregoing program may bestored in a computer readable storage medium, and when being executed,the program performs steps including the foregoing method embodiment.The storage medium includes: any medium that can store program code,such as a removable storage device, a read-only memory (ROM), a randomaccess memory (RAM), a magnetic disk, or an optical disc.

Alternatively, when the integrated module in the embodiments of thisapplication is implemented in the form of a software function module andsold or used as an independent product, the integrated module may bestored in a computer readable storage medium. Based on such anunderstanding, the technical solutions of the embodiments of thisapplication essentially, or the part contributing to the prior art maybe implemented in a form of a software product. The computer softwareproduct is stored in a storage medium and includes several instructionsfor instructing a computer device (which may be a personal computer, aserver, a network device, or the like) to perform all or some of themethods described in the embodiments of this application. The storagemedium includes: any medium that can store program code, such as amobile storage device, a ROM, a magnetic disk, or an optical disc.

In this application, the term “unit” or “module” in this applicationrefers to a computer program or part of the computer program that has apredefined function and works together with other related parts toachieve a predefined goal and may be all or partially implemented byusing software, hardware (e.g., processing circuitry and/or memoryconfigured to perform the predefined functions), or a combinationthereof. Each unit or module can be implemented using one or moreprocessors (or processors and memory). Likewise, a processor (orprocessors and memory) can be used to implement one or more modules orunits. Moreover, each module or unit can be part of an overall modulethat includes the functionalities of the module or unit. Obviously, aperson skilled in the art can make various modifications and variationsto this application without departing from the spirit and scope of thisapplication. In this case, if the modifications and variations made tothis application fall within the scope of the claims of this applicationand their equivalent technologies, this application is intended toinclude these modifications and variations.

What is claimed is:
 1. An application control method performed by anelectronic device that runs a native application and a sub-applicationnested in the native application, the method comprising: receiving, bythe native application, an object creation instruction transmitted bythe sub-application; in response to the object creation instruction,creating, by the native application, a native object, wherein the nativeobject is configured for performing operation on target multimediacontent in the sub-application; receiving, by the native application, anobject calling instruction transmitted by the sub-application; and inresponse to the object calling instruction, executing, by the nativeapplication, the native object and returning an execution result of thenative project to the sub-application, wherein the sub-application isconfigured for performing corresponding operation on target multimediacontent according to the execution result.
 2. The method according toclaim 1, wherein after creating the native object and before receivingthe object calling instruction transmitted by the sub-application, themethod further comprises: returning, by the native application, objectinformation obtained by creating the native object to thesub-application; determining, by the sub-application, the native objectcreated by the native application based on the object information; andtransmitting the object calling instruction according to the objectinformation.
 3. The method according to claim 2, wherein the objectinformation comprises the internal memory address and the class name;the object calling instruction carries the internal memory address andthe class name; The executing, by the native application, the nativeobject comprises: determining the internal memory allocated to thenative object according to the internal memory address, and determiningthe type of the native object according to the class name; and indexingthe internal memory allocated to the native object through the pointer,and calling the native object according to the type of the nativeobject.
 4. The method according to claim 1, wherein the creating, by thenative application, a native object comprises: selecting a target API tobe called to create the native object from a pre-configured applicationprogramming interface API set, wherein APIs in the API set areassociated with the audio and video editing capability of thesub-application; and calling the target API to create the native object.5. The method according to claim 1, wherein after creating the nativeobject, the method further comprises: storing the native object by aglobal data dictionary so as to keep the calling of the sub-applicationto the native object.
 6. The method according to claim 1, wherein thesub-application transmits the object creation instruction afterdetecting an operation request for the target multimedia content.
 7. Themethod according to claim 1, wherein the sub-application transmits theobject calling instruction after determining that the native object iscreated by the native application.
 8. An electronic device that runs anative application and a sub-application nested in the nativeapplication, comprising a processor and a memory, the memory storingprogram code, the program code, when executed by the processor, causingthe electronic device to perform an application control methodincluding: receiving, by the native application, an object creationinstruction transmitted by the sub-application; in response to theobject creation instruction, creating, by the native application, anative object, wherein the native object is configured for performingoperation on target multimedia content in the sub-application;receiving, by the native application, an object calling instructiontransmitted by the sub-application; and in response to the objectcalling instruction, executing, by the native application, the nativeobject and returning an execution result of the native project to thesub-application, wherein the sub-application is configured forperforming corresponding operation on target multimedia contentaccording to the execution result.
 9. The electronic device according toclaim 8, wherein after creating the native object and before receivingthe object calling instruction transmitted by the sub-application, themethod further comprises: returning, by the native application, objectinformation obtained by creating the native object to thesub-application; determining, by the sub-application, the native objectcreated by the native application based on the object information; andtransmitting the object calling instruction according to the objectinformation.
 10. The electronic device according to claim 9, wherein theobject information comprises the internal memory address and the classname; the object calling instruction carries the internal memory addressand the class name; The executing, by the native application, the nativeobject comprises: determining the internal memory allocated to thenative object according to the internal memory address, and determiningthe type of the native object according to the class name; and indexingthe internal memory allocated to the native object through the pointer,and calling the native object according to the type of the nativeobject.
 11. The electronic device according to claim 8, wherein thecreating, by the native application, a native object comprises:selecting a target API to be called to create the native object from apre-configured application programming interface API set, wherein APIsin the API set are associated with the audio and video editingcapability of the sub-application; and calling the target API to createthe native object.
 12. The electronic device according to claim 8,wherein after creating the native object, the method further comprises:storing the native object by a global data dictionary so as to keep thecalling of the sub-application to the native object.
 13. The electronicdevice according to claim 8, wherein the sub-application transmits theobject creation instruction after detecting an operation request for thetarget multimedia content.
 14. The electronic device according to claim8, wherein the sub-application transmits the object calling instructionafter determining that the native object is created by the nativeapplication.
 15. A non-transitory computer-readable storage medium,comprising program code, the program code, when executed by a processorof an electronic device that runs a native application and asub-application nested in the native application, causing the electronicdevice to perform an application control method including: receiving, bythe native application, an object creation instruction transmitted bythe sub-application; in response to the object creation instruction,creating, by the native application, a native object, wherein the nativeobject is configured for performing operation on target multimediacontent in the sub-application; receiving, by the native application, anobject calling instruction transmitted by the sub-application; and inresponse to the object calling instruction, executing, by the nativeapplication, the native object and returning an execution result of thenative project to the sub-application, wherein the sub-application isconfigured for performing corresponding operation on target multimediacontent according to the execution result.
 16. The non-transitorycomputer-readable storage medium according to claim 15, wherein aftercreating the native object and before receiving the object callinginstruction transmitted by the sub-application, the method furthercomprises: returning, by the native application, object informationobtained by creating the native object to the sub-application;determining, by the sub-application, the native object created by thenative application based on the object information; and transmitting theobject calling instruction according to the object information.
 17. Thenon-transitory computer-readable storage medium according to claim 16,wherein the object information comprises the internal memory address andthe class name; the object calling instruction carries the internalmemory address and the class name; The executing, by the nativeapplication, the native object comprises: determining the internalmemory allocated to the native object according to the internal memoryaddress, and determining the type of the native object according to theclass name; and indexing the internal memory allocated to the nativeobject through the pointer, and calling the native object according tothe type of the native object.
 18. The non-transitory computer-readablestorage medium according to claim 15, wherein the creating, by thenative application, a native object comprises: selecting a target API tobe called to create the native object from a pre-configured applicationprogramming interface API set, wherein APIs in the API set areassociated with the audio and video editing capability of thesub-application; and calling the target API to create the native object.19. The non-transitory computer-readable storage medium according toclaim 15, wherein after creating the native object, the method furthercomprises: storing the native object by a global data dictionary so asto keep the calling of the sub-application to the native object.
 20. Thenon-transitory computer-readable storage medium according to claim 15,wherein the sub-application transmits the object creation instructionafter detecting an operation request for the target multimedia content.